﻿
using System;
using System.Data;
using System.Data.SqlClient;
namespace Model
{
	
	/// <summary>	 
	/// 会员
	/// </summary>
	public class DbUsers
	{ 
		#region DbUsers
		/// <summary>
		/// 
		/// </summary>
		public DbUsers()
		{
		}
		/// <summary>	 
		/// 
		/// </summary>
		public DbUsers(Int32 userID)
		{
			this.userID = userID;
		
		}
		/// <summary>	 
		/// 
		/// </summary>		
		public DbUsers(DataRow dr)
		{
			int.TryParse(Convert.ToString(dr["userID"]),out userID);
			this.userName = Convert.ToString(dr["userName"]);
			this.userPwd = Convert.ToString(dr["userPwd"]);
			this.firstName = Convert.ToString(dr["firstName"]);
			this.lastName = Convert.ToString(dr["lastName"]);
			int.TryParse(Convert.ToString(dr["sex"]),out sex);
			this.tel = Convert.ToString(dr["tel"]);
			this.email = Convert.ToString(dr["email"]);
			this.address = Convert.ToString(dr["address"]);
			this.address2 = Convert.ToString(dr["address2"]);
			int.TryParse(Convert.ToString(dr["status"]),out status);
			this.zipCode = Convert.ToString(dr["zipCode"]);
			if(dr["addTime"] != DBNull.Value)
				this.addTime = Convert.ToDateTime(dr["addTime"]);
			this.city = Convert.ToString(dr["city"]);
			this.state = Convert.ToString(dr["state"]);
			this.country = Convert.ToString(dr["country"]);
			this.firstIP = Convert.ToString(dr["firstIP"]);
			this.lastIP = Convert.ToString(dr["lastIP"]);
			if(dr["lastLoginTime"] != DBNull.Value)
				this.lastLoginTime = Convert.ToDateTime(dr["lastLoginTime"]);
			this.totalCost = Convert.ToDecimal(dr["totalCost"]);
			int.TryParse(Convert.ToString(dr["loginTimes"]),out loginTimes);
			
		}
		#endregion
		
		
		#region UserID
		private Int32 userID;
		/// <summary>	 
		/// 
		/// AutoInc
		/// PK
		/// </summary>
		public Int32 UserID
		{
			get{ return userID; }
			set{ userID= value; }
		}
		#endregion
		
		#region UserName
		private System.String userName;
		/// <summary>	 
		/// 用户名
		/// </summary>
		public System.String UserName
		{
			get{ return userName; }
			set{ userName= value; }
		}
		#endregion
		
		#region UserPwd
		private System.String userPwd;
		/// <summary>	 
		/// 用户密码
		/// </summary>
		public System.String UserPwd
		{
			get{ return userPwd; }
			set{ userPwd= value; }
		}
		#endregion
		
		#region FirstName
		private System.String firstName;
		/// <summary>	 
		/// 姓
		/// </summary>
		public System.String FirstName
		{
			get{ return firstName; }
			set{ firstName= value; }
		}
		#endregion
		
		#region LastName
		private System.String lastName;
		/// <summary>	 
		/// 名
		/// </summary>
		public System.String LastName
		{
			get{ return lastName; }
			set{ lastName= value; }
		}
		#endregion
		
		#region Sex
		private Int32 sex;
		/// <summary>	 
		/// 性别
		/// </summary>
		public Int32 Sex
		{
			get{ return sex; }
			set{ sex= value; }
		}
		#endregion
		
		#region Tel
		private System.String tel;
		/// <summary>	 
		/// 联系电话
		/// </summary>
		public System.String Tel
		{
			get{ return tel; }
			set{ tel= value; }
		}
		#endregion
		
		#region Email
		private System.String email;
		/// <summary>	 
		/// 邮件
		/// </summary>
		public System.String Email
		{
			get{ return email; }
			set{ email= value; }
		}
		#endregion
		
		#region Address
		private System.String address;
		/// <summary>	 
		/// 联系地址
		/// </summary>
		public System.String Address
		{
			get{ return address; }
			set{ address= value; }
		}
		#endregion
		
		#region Address2
		private System.String address2;
		/// <summary>	 
		/// 联系地址2
		/// </summary>
		public System.String Address2
		{
			get{ return address2; }
			set{ address2= value; }
		}
		#endregion
		
		#region Status
		private Int32 status;
		/// <summary>	 
		/// 状态
		/// </summary>
		public Int32 Status
		{
			get{ return status; }
			set{ status= value; }
		}
		#endregion
		
		#region ZipCode
		private System.String zipCode;
		/// <summary>	 
		/// 邮编
		/// </summary>
		public System.String ZipCode
		{
			get{ return zipCode; }
			set{ zipCode= value; }
		}
		#endregion
		
		#region AddTime
		private DateTime addTime;
		/// <summary>	 
		/// 添加时间
		/// </summary>
		public DateTime AddTime
		{
			get{ return addTime; }
			set{ addTime= value; }
		}
		#endregion
		
		#region City
		private System.String city;
		/// <summary>	 
		/// 城市
		/// </summary>
		public System.String City
		{
			get{ return city; }
			set{ city= value; }
		}
		#endregion
		
		#region State
		private System.String state;
		/// <summary>	 
		/// 地区
		/// </summary>
		public System.String State
		{
			get{ return state; }
			set{ state= value; }
		}
		#endregion
		
		#region Country
		private System.String country;
		/// <summary>	 
		/// 国家
		/// </summary>
		public System.String Country
		{
			get{ return country; }
			set{ country= value; }
		}
		#endregion
		
		#region FirstIP
		private System.String firstIP;
		/// <summary>	 
		/// 注册IP
		/// </summary>
		public System.String FirstIP
		{
			get{ return firstIP; }
			set{ firstIP= value; }
		}
		#endregion
		
		#region LastIP
		private System.String lastIP;
		/// <summary>	 
		/// 最近登录IP
		/// </summary>
		public System.String LastIP
		{
			get{ return lastIP; }
			set{ lastIP= value; }
		}
		#endregion
		
		#region LastLoginTime
		private DateTime lastLoginTime;
		/// <summary>	 
		/// 最近登录时间
		/// </summary>
		public DateTime LastLoginTime
		{
			get{ return lastLoginTime; }
			set{ lastLoginTime= value; }
		}
		#endregion
		
		#region TotalCost
		private Decimal totalCost;
		/// <summary>	 
		/// 总消费
		/// </summary>
		public Decimal TotalCost
		{
			get{ return totalCost; }
			set{ totalCost= value; }
		}
		#endregion
		
		#region LoginTimes
		private Int32 loginTimes;
		/// <summary>	 
		/// 登录次数
		/// </summary>
		public Int32 LoginTimes
		{
			get{ return loginTimes; }
			set{ loginTimes= value; }
		}
		#endregion

	}
}
